package com.dgut.config;

import cn.dev33.satoken.stp.StpInterface;
import com.dgut.service.UserService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Component
public class StpInterfaceImpl implements StpInterface {

    @Resource
    private UserService userService;
    @Override
    public List<String> getPermissionList(Object o, String s) {
        return null;
    }


    /**
     * 获取角色
     * @param o  Integer.parseInt((String)o))
     * @param s
     * @return
     */
    @Override
    public List<String> getRoleList(Object o, String s) {
        List<String> list = new ArrayList<>();
        list.add(userService.getRole(Integer.parseInt((String)o)));
        return list;
    }
}
